import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { UserModule } from './user/user.module';
import { User } from './user/dto/user.entity';
import { NoteModule } from './note-data/note.module';
import { NoteContentData } from './note-data/dto/note-data.entity';
import { UploadModule } from './upload/upload.module';
import { AuthModule } from './auth/auth.module';
import { CommentModule } from './comment/comment.module';
import { CommentData } from './comment/dto/comment.entity';
import { GatewayModule } from './gateway/gateway.module';
import { SocketModule } from './socket/socket.module';
import { TaskModule } from './task/task.module';
import { UserTask } from './task/dto/task.entity';
import { RedisCacheModule } from './redis-cache/redis-cache.module';

@Module({
  imports: [
    ConfigModule.forRoot({ isGlobal: true }),
    // TypeOrmModule.forRoot({
    //   type: 'mysql',
    //   host: '156.241.132.46',
    //   port: 3306,
    //   username: 'root',
    //   password: 'luliang0314.',
    //   database: 'note_best_dome',
    //   timezone: '+08:00',
    //   synchronize: true,
    //   entities: [User, NoteContentData, CommentData, UserTask],
    // }),
    TypeOrmModule.forRoot({
      type: 'mysql',
      host: 'localhost',
      port: 3306,
      username: 'root',
      password: 'luliang0314.',
      timezone: '+08:00',
      database: 'localhost-note',
      synchronize: true,
      entities: [User, NoteContentData, CommentData, UserTask],
    }),
    NoteModule,
    UserModule,
    UploadModule,
    AuthModule,
    CommentModule,
    GatewayModule,
    SocketModule,
    TaskModule,
    RedisCacheModule,
  ],
})
export class AppModule {}
